/******************************************************************************* * Copyright (c) 2012, Project: FP7-ICT-257930 Aniketos * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * - Neither the name of institution nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ /** */ package org.eclipse.dd.dc.impl; import org.eclipse.dd.dc.Bounds; import org.eclipse.dd.dc.DcPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Bounds</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.dd.dc.impl.BoundsImpl#getHeight <em>Height</em>}</li> * <li>{@link org.eclipse.dd.dc.impl.BoundsImpl#getWidth <em>Width</em>}</li> * <li>{@link org.eclipse.dd.dc.impl.BoundsImpl#getX <em>X</em>}</li> * <li>{@link org.eclipse.dd.dc.impl.BoundsImpl#getY <em>Y</em>}</li> * </ul> * </p> * * @generated */ public class BoundsImpl extends EObjectImpl implements Bounds { /** * The default value of the '{@link #getHeight() <em>Height</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getHeight() * @generated * @ordered */ protected static final float HEIGHT_EDEFAULT = 0.0F; /** * The cached value of the '{@link #getHeight() <em>Height</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getHeight() * @generated * @ordered */ protected float height = HEIGHT_EDEFAULT; /** * The default value of the '{@link #getWidth() <em>Width</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getWidth() * @generated * @ordered */ protected static final float WIDTH_EDEFAULT = 0.0F; /** * The cached value of the '{@link #getWidth() <em>Width</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getWidth() * @generated * @ordered */ protected float width = WIDTH_EDEFAULT; /** * The default value of the '{@link #getX() <em>X</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getX() * @generated * @ordered */ protected static final float X_EDEFAULT = 0.0F; /** * The cached value of the '{@link #getX() <em>X</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getX() * @generated * @ordered */ protected float x = X_EDEFAULT; /** * The default value of the '{@link #getY() <em>Y</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getY() * @generated * @ordered */ protected static final float Y_EDEFAULT = 0.0F; /** * The cached value of the '{@link #getY() <em>Y</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getY() * @generated * @ordered */ protected float y = Y_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected BoundsImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DcPackage.Literals.BOUNDS; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public float getHeight() { return height; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setHeight(float newHeight) { float oldHeight = height; height = newHeight; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__HEIGHT, oldHeight, height)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public float getWidth() { return width; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setWidth(float newWidth) { float oldWidth = width; width = newWidth; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__WIDTH, oldWidth, width)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public float getX() { return x; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setX(float newX) { float oldX = x; x = newX; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__X, oldX, x)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public float getY() { return y; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setY(float newY) { float oldY = y; y = newY; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__Y, oldY, y)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DcPackage.BOUNDS__HEIGHT: return getHeight(); case DcPackage.BOUNDS__WIDTH: return getWidth(); case DcPackage.BOUNDS__X: return getX(); case DcPackage.BOUNDS__Y: return getY(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DcPackage.BOUNDS__HEIGHT: setHeight((Float)newValue); return; case DcPackage.BOUNDS__WIDTH: setWidth((Float)newValue); return; case DcPackage.BOUNDS__X: setX((Float)newValue); return; case DcPackage.BOUNDS__Y: setY((Float)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DcPackage.BOUNDS__HEIGHT: setHeight(HEIGHT_EDEFAULT); return; case DcPackage.BOUNDS__WIDTH: setWidth(WIDTH_EDEFAULT); return; case DcPackage.BOUNDS__X: setX(X_EDEFAULT); return; case DcPackage.BOUNDS__Y: setY(Y_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DcPackage.BOUNDS__HEIGHT: return height != HEIGHT_EDEFAULT; case DcPackage.BOUNDS__WIDTH: return width != WIDTH_EDEFAULT; case DcPackage.BOUNDS__X: return x != X_EDEFAULT; case DcPackage.BOUNDS__Y: return y != Y_EDEFAULT; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (height: "); result.append(height); result.append(", width: "); result.append(width); result.append(", x: "); result.append(x); result.append(", y: "); result.append(y); result.append(')'); return result.toString(); } } //BoundsImpl